<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<link rel=File-List href="./pool_bestanden/filelist.xml">
<!--[if gte mso 9]><xml>
 <o:DocumentProperties>
  <o:LastAuthor>Erik</o:LastAuthor>
  <o:Revision>97</o:Revision>
  <o:TotalTime>516</o:TotalTime>
  <o:LastPrinted>2002-05-15T11:24:00Z</o:LastPrinted>
  <o:Created>2002-04-16T19:32:00Z</o:Created>
  <o:LastSaved>2002-05-15T11:27:00Z</o:LastSaved>
  <o:Pages>6</o:Pages>
  <o:Words>1767</o:Words>
  <o:Characters>10077</o:Characters>
  <o:Company>None</o:Company>
  <o:Lines>83</o:Lines>
  <o:Paragraphs>20</o:Paragraphs>
  <o:CharactersWithSpaces>12375</o:CharactersWithSpaces>
  <o:Version>9.2812</o:Version>
 </o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:HyphenationZone>21</w:HyphenationZone>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Font Definitions */
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:553679495 -2147483648 8 0 66047 0;}
 /* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	background:navy;
	font-size:12.0pt;
	font-family:Tahoma;
	mso-fareast-font-family:"Times New Roman";}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Courier New";
	mso-fareast-font-family:"Times New Roman";}
@page Section1
	{size:8.5in 11.0in;
	margin:.8in .8in .7in .7in;
	mso-header-margin:.2in;
	mso-footer-margin:.2in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
@list l0
	{mso-list-id:491943773;
	mso-list-type:hybrid;
	mso-list-template-ids:389161538 700215070 68354051 68354053 68354049 68354051 68354053 68354049 68354051 68354053;}
@list l0:level1
	{mso-level-start-at:2;
	mso-level-number-format:bullet;
	mso-level-text:-;
	mso-level-tab-stop:53.4pt;
	mso-level-number-position:left;
	margin-left:53.4pt;
	text-indent:-.25in;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";}
@list l1
	{mso-list-id:2044330862;
	mso-list-type:hybrid;
	mso-list-template-ids:1794557052 1241923622 68354073 68354075 68354063 68354073 68354075 68354063 68354073 68354075;}
@list l1:level1
	{mso-level-tab-stop:106.15pt;
	mso-level-number-position:left;
	margin-left:106.15pt;
	text-indent:-35.35pt;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
-->
</style>
<meta name=CVS content="$Id: pool.html,v 1.2 2004/01/15 06:36:14 andreas_kupries Exp $">
<meta name=CVS content="$Id: pool.html,v 1.2 2004/01/15 06:36:14 andreas_kupries Exp $">
<meta name=CVS content="\$Id: pool.html,v 1.2 2004/01/15 06:36:14 andreas_kupries Exp $">
</head>

<body lang=NL style='tab-interval:35.4pt'>

<div class=Section1>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText align=center style='text-align:center;mso-outline-level:
1'><b><span style='font-size:16.0pt;font-family:"Times New Roman"'>POOL 0.1<o:p></o:p></span></b></p>

<p class=MsoPlainText align=center style='text-align:center'><span
style='font-size:11.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText align=center style='text-align:center;mso-outline-level:
1'><span style='font-size:11.0pt;font-family:"Times New Roman"'>Author: Erik
Leunissen<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:11.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:11.0pt;font-family:"Times New Roman"'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>NAME<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>pool
- Managing a pool of discrete items.<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>SYNOPSIS<o:p></o:p></span></b></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><span style='mso-tab-count:1'></span><b>pool
</b><i>?poolName? ?maxsize?</i><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>DESCRIPTION</span></b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:11.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
<i>pool</i> command creates a new instance of a pool data structure. The command
takes the name of the new pool as its first argument. If no name is supplied,
then the new pool will be named pool&lt;X&gt;, where X is a positive integer.
The optional second argument <i>maxsize</i> is a positive integer indicating
the maximum size of the pool; this is the maximum number of items the pool may
hold.</span><span lang=EN-GB style='mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>POOLS AND ALLOCATION<o:p></o:p></span></b></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
purpose of the <i>pool</i> command and the pool object command that it
generates, is to manage pools of discrete items.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Examples
of a pool of discrete items are:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>the seats in a cinema, theatre,
train etc.. for which visitors/travellers can<span style="mso-spacerun: yes">
</span>make a reservation;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>the dynamic IP-addresses that an ISP
can dole out<span style="mso-spacerun: yes"></span>to subscribers;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>a car rental's collection of cars,
which can be rented by customers;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>the class rooms in a school
building, which need to be scheduled;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>the database connections available
to client-threads in a web-server application;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in;mso-list:
l0 level1 lfo2;tab-stops:list 53.4pt'><![if !supportLists]><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'>the books in a library that
customers can borrow;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:53.4pt;text-indent:-.25in'><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>etc ...<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
common denominator in the examples is that there is a more or less fixed number
of items (seats, IP-addresses, cars, ...) that are supposed to be allocated on
a more or less regular basis. An item can be allocated only once at a time. An
item that is allocated, must be released before it can be re-allocated. While
several items in a pool are being allocated and released continuously, the
total number of items in the pool remains constant.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Keeping
track of which items are allocated, and by whom, is the purpose of the <i>pool</i>
command and its subordinates.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Pool parlance<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>If
we say that an item is allocated, it means that the item is <i>busy</i>, <i>owned</i>
or <i>occupied</i>; it is not available anymore. If an item is free, it is
available. <i>Deallocating</i> an item is equivalent to <i>setting free</i> or <i>releasing</i>
an item. The person or entity to which the item has been allotted is said to <i>own</i>
the item.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><b><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>ITEMS<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Discrete items<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
<i>pool</i> command is designed for <b>discrete items only</b>. Note that there
are pools where allocation occurs on a non-discrete basis, for example computer
memory. There are also pools from which the shares that are doled out are not
expected to be returned, for example a charity fund or a pan of soup from which
you may receive a portion. Finally, there are even pools from which nothing is
ever allocated or returned, like a swimming pool or a cesspool.<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Unique item names<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>A pool cannot manage duplicate item names. Therefore, items in a pool
must have unique names.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><b><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span><o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Item equivalence<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>From
the point of view of the manager of a pool, items are equivalent. The manager
of a pool is indifferent about which entity/person occupies a given item.
However, clients may have preferences for a particular item, based on some item
property they know.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Preferences<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>A
future owner may have a preference for a particular item. Preference based
allocation is supported (see the <b>-prefer</b> option to the <i>request</i>
subcommand). A preference for a particular item is most likely to result from
variability among features associated with the items. Note that the pool
commands themselves are not designed to manage such item properties. If item
properties play a role in an application, they should be<span
style="mso-spacerun: yes"></span>managed separately. <o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>POOL OBJECT COMMAND<o:p></o:p></span></b></p>

<p class=MsoPlainText><b><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
14.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
<i>pool</i> command creates a new Tcl command whose name is <i>poolName</i> .
This pool object command is used to manipulate or query the pool object. The
general syntax of a pool object command is:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
style='mso-tab-count:1'></span><i>poolName</i> <b>subcommand</b> <i>?arg
arg ...?</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
following subcommands and corresponding arguments are available:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>add</b> <i>itemName1 ?itemName2 itemName3 ...?</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>This
command adds the items on the command line to the pool. If duplicate item names
occur on the command line, an error is raised. If one or more of the items
already exist in the pool, this also is considered an error.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
style='mso-tab-count:1'></span><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>clear</b> <i>?-force?</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Removes
all items from the pool. If there are any allocated items at the time when the
command is invoked, an error is raised. This behaviour may be modified through
the <i>-force</i> argument. If it is supplied on the command line, the pool
will be cleared regardless the allocation state of its items.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>destroy</b> <i>?-force?<o:p></o:p></i></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Destroys
the pool data structure, all associated variables and the associated pool
object command. By default, the command checks whether any items are still
allocated and raises an error if such is the case. This behaviour may be
modified through the argument -<i>force</i>. If it is supplied on the command
line, the pool data structure will be destroyed regardless allocation state of
its items. <o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-fareast-font-family:
"Times New Roman";mso-ansi-language:EN-GB;mso-fareast-language:NL;mso-bidi-language:
AR-SA'><br clear=all style='page-break-before:always'>
</span>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>info</b> <i>type ?arg?<o:p></o:p></i></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:.5in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Returns
various information about the pool for further programmatic use. The type
argument indicates the type of information requested. Only the <i>allocID</i>
type uses an additional argument.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:.5in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>allocID </span></b><i><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>itemName<o:p></o:p></span></i></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>returns the allocID of the item whose name is <i>itemName.</i>
Free items have an allocation ID -1.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>allitems<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><span style='mso-tab-count:1'></span></span></b><span
lang=EN-GB style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>returns a list of all items in the pool.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>allocstate<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Returns a list of key-value pairs, where the keys are
the items and the values &nbsp;are the corresponding&nbsp;allocation ID's. Free
items have an allocation ID -1.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>cursize<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>returns &nbsp;the current pool size, i.e. the
&nbsp;number of items in the pool.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>freeitems</span></b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.5in;margin-bottom:
0in;margin-left:107.4pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>returns
a list of items that currently are not allocated.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:71.4pt;margin-bottom:.0001pt'><b><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>maxsize<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>returns &nbsp;the maximum size of the pool.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:1.0in;margin-bottom:
0in;margin-left:105.6pt;margin-bottom:.0001pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>maxsize</b> <i>?maxsize?<o:p></o:p></i></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Sets or queries the maximum size of the pool,
depending on whether the <i>maxsize</i> argument is supplied. If the optional
argument <i>maxsize</i> is supplied, the maximum size of the pool will<span
style="mso-spacerun: yes"></span>be set to that value. If no argument <i>maxsize</i>
is supplied, the current maximum size of the pool is returned. In this variant,
the command is an alias for: </span><span lang=EN-GB style='font-size:10.5pt;
mso-bidi-font-size:10.0pt;mso-ansi-language:EN-GB'>poolName info maxsize</span><span
lang=EN-GB style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>The <i>maxsize</i> argument needs to be a positive
integer.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><span style="mso-spacerun: yes"></span><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>release</b> <i>itemName<o:p></o:p></i></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>Releases the item whose name is <i>itemName</i> that
was allocated previously. An error is raised if the item was not allocated at
the time when the command was issued.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;mso-bidi-font-size:10.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'><span style="mso-spacerun: yes"></span><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>remove</b> <i>itemName ?-force?</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Removes
the item whose name is <i>itemName</i><span style="mso-spacerun: yes">
</span>from the pool. If the item was allocated at the time when the command
was invoked, an error is raised. This behaviour may be modified through the
optional argument <i>-force</i>. If it is supplied on the command line, the
item will be removed regardless its allocation state.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<span lang=EN-GB style='font-size:10.0pt;font-family:"Courier New";mso-fareast-font-family:
"Times New Roman";mso-ansi-language:EN-GB;mso-fareast-language:NL;mso-bidi-language:
AR-SA'><br clear=all style='page-break-before:always'>
</span>

<p class=MsoPlainText style='margin-left:35.4pt'><i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>poolName</span></i><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <b>request</b> <i>itemVar ?options?</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Handles
a request for an item, taking into account a possible preference for a
particular item.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>There
are two possible outcomes depending on the availability of items:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:1.25in;text-indent:-19.2pt;mso-list:
l1 level1 lfo4'><![if !supportLists]><span lang=EN-GB style='font-size:11.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>1.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>The request is honoured, an item is allocated and the variable whose
name is passed with the argument <i>itemVar</i> will be set to the name of the
item that was allocated. The command returns 1.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:1.25in;text-indent:-19.2pt;mso-list:
l1 level1 lfo4'><![if !supportLists]><span lang=EN-GB style='font-size:11.0pt;
font-family:"Times New Roman";mso-ansi-language:EN-GB'>2.<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>The request is denied. No item is allocated. The variable whose name is <i>itemVar</i>
is not set. Attempts to read <i>itemVar</i><span style="mso-spacerun: yes">
</span>may raise an error if the variable was not defined before issuing the
request. The command returns 0.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
return values from this command are meant to be inspected. The examples below
show how to do this. Failure to check the return value may result in erroneous
behaviour.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>If
no preference for a particular item is supplied through the option <b>-prefer</b>
(see below), then all requests are honoured as long as items are available.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>The
following options are supported:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><b><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-allocID</span></b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'> <i>allocID</i><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:106.2pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>If
the request is honoured, an item will be allocated to the entity identified by <i>allocID</i>.
If the allocation state of an item is queried, it is this allocation ID that
will be returned. If the option <b>-allocID</b> is not supplied, the item will
be allocated to<span style="mso-spacerun: yes"></span><i>dummyID</i>.
Allocation ID's may be anything except the value -1, which is reserved for free
items.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:70.8pt'><b><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>-prefer
</span></b><i><span lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>preferredItem</span></i><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:106.2pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>This
option modifies the allocation strategy as follows:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:106.2pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>If
the item whose name is <i>preferredItem</i> is not allocated at the time when
the command is invoked, the request is honoured (return value is 1). If the item
was allocated at the time when the command was invoked, the request is denied
(return value is 0).<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:106.2pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:106.2pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><b><span lang=EN-GB
style='font-size:12.0pt;mso-bidi-font-size:14.0pt;font-family:"Times New Roman";
mso-ansi-language:EN-GB'>EXAMPLES<o:p></o:p></span></b></p>

<p class=MsoPlainText><b><span lang=EN-GB style='font-size:12.0pt;mso-bidi-font-size:
14.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Two
examples are provided. The first one mimics a step by step interactive tclsh session,
where each step is explained. The second example shows the usage in a server
application that talks to a back-end application.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Example 1<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>This
example presents an interactive tclsh session which considers the case of a Car
rental's collection of cars. Ten steps explain its usage in chronological
order, from the creation of the pool, via the most important stages in the
usage of a pool, to the final destruction.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:63.0pt;margin-bottom:
0in;margin-left:81.0pt;margin-bottom:.0001pt'><span lang=EN-GB
style='mso-bidi-font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Note aside:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-top:0in;margin-right:63.0pt;margin-bottom:
0in;margin-left:81.0pt;margin-bottom:.0001pt'><span lang=EN-GB
style='mso-bidi-font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>In this example, brand names are used to label the various items.
However, a brand name could be regarded as a property of an item. Because the <i>pool</i>
command is not designed to manage properties of items, they need to be managed
separately. In the latter case the items should be labelled with more neutral
names such as: car1, car2, car3 , etc ... and a separate database or array
should hold the brand names associated with the car labels.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>1.
Load the package into an interpreter<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
package require pool<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;color:blue;mso-ansi-language:
EN-GB'>0.1<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>2.
Create a pool object called `CarPool' with a maximum size of 55 items (cars):<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
pool CarPool 55<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;color:blue;mso-ansi-language:
EN-GB'>CarPool<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>4.
Add items to the pool:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
CarPool add Toyota Trabant Chrysler1 Chrysler2 Volkswagen<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><span
style='mso-tab-count:1'></span><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>5.
Somebody crashed the Toyota? Remove it from the pool as follows:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
CarPool remove Toyota<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>6.
Acquired a new car for the pool? Add it as follows:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
CarPool add Nissan<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>7.
Check whether the pool was adjusted correctly:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>% CarPool info allitems<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;color:blue;mso-ansi-language:
EN-GB'>Trabant Chrysler1 Chrysler2 Volkswagen Nissan<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Suspend
interactive session temporarily, and show the programmatic use of the <b>request</b>
subcommand:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>#
Mrs. Swift needs a car. She doesn't have a preference for a<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>#
particular car. We'll issue a request on her behalf as follows:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>if {
[CarPool request car -allocID &quot;Mrs. Swift&quot;] }<span
style="mso-spacerun: yes"></span>{<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt;mso-outline-level:
1'><span lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;
mso-ansi-language:EN-GB'># request was honoured, process the variable `car'<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>puts &quot;$car has been allocated to [CarPool info allocID $car].&quot;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>} else {<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'># request was denied<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style='mso-tab-count:1'></span>puts &quot;No car available.&quot;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>}<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>(note how the <b>if</b> command uses the value returned by the request
subcommand.)<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>#
Suppose mr. Wiggly has a preference for the Trabant:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>if {
[CarPool request car -allocID &quot;Mr. Wiggly&quot; -prefer Trabant] }<span
style="mso-spacerun: yes"></span>{<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt;mso-outline-level:
1'><span lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;
mso-ansi-language:EN-GB'># request was honoured, process the variable `car'<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>puts &quot;$car has been allocated to [CarPool info allocID $car].&quot;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>} else {<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;text-indent:35.4pt'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'># request was denied<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style='mso-tab-count:1'></span>puts &quot;The Trabant was not
available.&quot;<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>}<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Resume
interactive session:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>8.
When the car is returned then you can render it available by:<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
CarPool release Trabant<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>9.
When done, you delete the pool.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'>% CarPool destroy<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;color:#FF6600;mso-ansi-language:
EN-GB'>Couldn't destroy `CarPool' because some items are still allocated.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>Oops,
... forgot that Mrs. Swift still occupies a car.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>10.
We force the destruction of the pool as follows: <o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>%
CarPool destroy -force<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><b><span
lang=EN-GB style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:
EN-GB'>Example 2<o:p></o:p></span></b></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>This
example describes the case from which the author's need for pool management
originated. It is an example of a server application that receives requests
from client applications. The client requests are dispatched onto a back-end
application before being returned to the client application. In many cases
there are a few equivalent instances of back-end applications to which a client
request may be passed along. The file descriptors that identify the channels to
these back-end instances make up a pool of connections. A particular connection
may be allocated to just one client request at a time.<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'># Create
the pool of connections (pipes)<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>set
maxpipes 10<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>pool
Pipes $maxpipes<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>for
{set i 0} {$i &lt; $maxpipes} {incr i} {<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:
11.0pt;mso-ansi-language:EN-GB'><span style='mso-tab-count:1'></span><span
style="mso-spacerun: yes"></span>set fd {open "|backendApplication" w+}<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:
11.0pt;mso-ansi-language:EN-GB'><span style='mso-tab-count:1'></span><span
style="mso-spacerun: yes"></span>Pipes add $fd<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:
11.0pt;mso-ansi-language:EN-GB'><span style='mso-tab-count:1'></span>}<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'># A
client request comes in. The request is identified as `clientX'.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'># Dispatch it onto an instance of a back-end application<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>if {
[Pipes request fd -allocID clientX] } {<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'><span style="mso-spacerun: yes"></span># a connection was allocated<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span># communicate to the back-end application
via the variable `fd'<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span>puts $fd "someInstruction"<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span># ...... etc.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>}
else {<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt;mso-outline-level:1'><span
lang=EN-GB style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:
EN-GB'><span style="mso-spacerun: yes"></span># all connections are
currently occupied<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span># store the client request in a queue for
later processing,<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'><span
style="mso-spacerun: yes"></span># or return a "Server busy" message to the
client.<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ansi-language:EN-GB'>}<o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='margin-left:35.4pt'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

<p class=MsoPlainText style='mso-outline-level:1'><span lang=EN-GB
style='font-size:11.0pt;font-family:"Times New Roman";mso-ansi-language:EN-GB'>#
</span><span lang=EN-GB style='font-family:"Times New Roman";mso-ansi-language:
EN-GB'>CVS: $Id: pool.html,v 1.2 2004/01/15 06:36:14 andreas_kupries Exp $<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'># EOF pool.html<o:p></o:p></span></p>

<p class=MsoPlainText><span lang=EN-GB style='font-size:11.0pt;font-family:
"Times New Roman";mso-ansi-language:EN-GB'><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></span></p>

</div>

</body>

</html>
